<template>
  <div>
    <Nav :title="title" :back="back"></Nav>
    <div class="item">
        <movieItem v-for="item in value" :key="item.title" :value="item"></movieItem>
    </div>
  </div>
</template>

<script>
import movie from "../models/movie";
import movieItem from '../components/MovieItem'
export default {
  data() {
    return {
      title: "",
      back: "/movieLIst",
      value: []
    };
  },
  components:{
      movieItem
  },
  async mounted() {
    console.log(this.$route.query);
    let { c, title } = this.$route.query;
    var value = await movie(c);
    this.value = value.data.res;
    this.title = title;
    console.log(this.value);
  }
};
</script>

<style scoped>
.item{
    margin-top: 20rpx;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    justify-items: center;
    align-items: center;
}
</style>